package com.sale.system.dubbo;

import com.sale.system.api.RemoteSysConverterService;
import com.sale.system.api.domain.dto.SysConverterManagementDto;
import com.sale.system.service.ConverterManagementService;
import lombok.RequiredArgsConstructor;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

/**
 * 加工商dubbo实现类
 */
@RequiredArgsConstructor
@Service
@DubboService
public class RemoteSysConverterServiceImpl implements RemoteSysConverterService {

    private final ConverterManagementService converterManagementService;

    /**
     * 根据id获取详情数据（dubbo）
     */
    @Override
    public SysConverterManagementDto getConverterById(Long id) {
        return converterManagementService.getViewById(id);
    }

    /**
     * 根据编码获取详情数据（dubbo）
     */
    @Override
    public SysConverterManagementDto getConverterByCode(String code) {
       return converterManagementService.getViewByCode(code);
    }
}
